package com.thoughtorigin.reflect {
import flash.utils.Dictionary;
import flash.utils.describeType;
import flash.utils.getQualifiedClassName;

public class Describe {

    private static var _cache: Dictionary;

    public static function type(obj: Object): XML {
        var fqcn: String = getQualifiedClassName(obj);
        if(!_cache) {
            _cache = new Dictionary();
        }
        if(_cache[fqcn]) {
            return _cache[fqcn];
        }
        _cache[fqcn] = describeType(obj);
        return _cache[fqcn];
    }

    public static function set cache(value: Dictionary): void {
        _cache = value;        
    }
}
}